﻿@using HGShare.Site.Config
@using HGShare.VWModel
@using Webdiyer.WebControls.Mvc
@model PagedList<AttachmentVModel>
@{
    ViewBag.Title = "Attachment列表";
    Layout = "~/Views/Shared/_HContentLayout.cshtml";
}
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>Attachment列表</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form action="@Url.Action("Index", "Attachments")" method="GET">
                        <div class="row">
                            <div class="col-sm-5 m-b-xs">
                                <a href="@Url.Action("Add","Attachments")" class="btn btn-outline btn-default">
                                    <i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
                                </a>
                                <button class="btn btn-default btn-outline" type="button" name="refresh" title="刷新" id="pagereload">
                                    <i class="glyphicon glyphicon-repeat"></i>
                                </button>
                                <button type="button" class="btn btn-outline btn-default" id="deletessubmit">
                                    <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
                                </button>
                            </div>
                            <div class="col-sm-4 m-b-xs">
                                <!--其它搜索条件-->
                            </div>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input type="hidden" name="page" value="1" />
                                    <input type="text" placeholder="请输入关键词" class="input-sm form-control">
                                    <span class="input-group-btn">
                                        <button type="submit" class="btn btn-sm btn-primary"> 搜索</button>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </form>
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                                <tr>
                                    <th><div class="checkbox i-checks"><input type="checkbox" value="0" id="selectdeleteitem" class="form-control" /></div></th>
                                    <th>附件Id</th>
                                    <th>文件存储名</th>
                                    <th>文件原名</th>
                                    <th>描述</th>
                                    <th>文件类型</th>
                                    <th>img 宽</th>
                                    <th>img 高</th>
                                    <th>文件大小</th>
                                    <th>是否显示0 不显示 1显示</th>
                                    <th>所属文章Id</th>
                                    <th>文件来源（用于记录程序中各个上传口）</th>
                                    <th>状态 0 初始状态 1已审核通过 2审核未通过（用于文件审核）</th>
                                    <th>用户Id</th>
                                    <th>上传唯一标示(上传页面初始化后产生)</th>
                                    <th>添加时间</th>
                                    <th>0附件 1图片</th>
                                    <th>文件存储觉得路径</th>
                                    <th>文件相对目录</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach (AttachmentVModel item in Model)
                                {
                                    <tr>
                                        <td>
                                            <div class="checkbox i-checks">
                                                <input type="checkbox" value="@item.Id" id="deleteitem_@item.Id" name="deleteitem" class="form-control" />
                                            </div>
                                        </td>

                                        <td>@item.Id</td>
                                        <td>@item.FileName</td>
                                        <td>@item.FileTitle</td>
                                        <td>@item.Description</td>
                                        <td>@item.Type</td>
                                        <td>@item.Width</td>
                                        <td>@item.Height</td>
                                        <td>@item.FileSize</td>
                                        <td>@(item.IsShow ? "是" : "否")</td>
                                        <td>@item.AId</td>
                                        <td>@item.Score</td>
                                        <td>@item.State</td>
                                        <td>@item.UserId</td>
                                        <td>@item.GUID</td>
                                        <td>@item.InTime</td>
                                        <td>@item.BType</td>
                                        <td>@item.LocalPath</td>
                                        <td>@item.VirtualPath</td>
                                        <td>
                                            <a class="btn btn-info btn-sm" href="@Url.Action("Edit","Attachments")?Id=@item.Id"><i class="fa fa-paste"></i> 编辑</a>
                                            <button class="btn btn-warning btn-sm delete_btn" type="button" data-id="@item.Id">
                                                <i class="fa fa-warning"></i> <span class="bold">删除</span>
                                            </button>
                                        </td>
                                    </tr>
                                }
                            </tbody>
                        </table>
                    </div>

                </div>
            </div>
        </div>

    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="dataTables_info">共 @Model.TotalItemCount 项 @Model.TotalPageCount 页，当前第 @Model.CurrentPageIndex 页</div>
        </div>
        <div class="col-sm-6">
            <div class="dataTables_paginate paging_simple_numbers">
                <ul class="pagination">
                    @Html.Pager(Model, PageConfig.BackstageOptions)
                </ul>
            </div>
        </div>
    </div>
</div>
@section script_footer
{
    <script type="text/javascript">
        $(function () {
            /*通用删除操作*/
            ListTools.Delete.Init({ url: "@Url.Action("Delete","Attachments")", btn: ".delete_btn" });
			/*通用多选删除操作*/
            ListTools.Deletes.Init({ url: "@Url.Action("Deletes","Attachments")", btn: "#deletessubmit", itemname: "deleteitem" });
            /*删除选择操作*/
            ListTools.DeleteSelectBox.Init({ btn: "#selectdeleteitem", itemname: "deleteitem" });
			/*刷新操作*/
            ListTools.PageReload.Init({ btn: "#pagereload"});
        })
    </script>
}











